function getOnlinePlayersName(){
    let plCount = 0;
    let listRes = '';
    for (let bdsuuid in WSC.client.onlinePlayersInfo){
        if (Object.values(WSC.client.onlinePlayersInfo[bdsuuid]).length != 0){
            listRes += `\n\n[${Object.values(WSC.client.onlineClientsInfo).find(client=>client.bds.uuid==bdsuuid)?.name}] \n${Object.values(WSC.client.onlinePlayersInfo[bdsuuid]).map(playersInfo=>playersInfo.realName).join(', ')}`;
            plCount += Object.values(WSC.client.onlinePlayersInfo[bdsuuid]).length;
        }
    }
    return `当前在线(${plCount}):` + listRes;
}

function getOnlinePlayersNum(){
    return Object.values(WSC.client.onlinePlayersInfo).flat().length;
}

module.exports = {
    getOnlinePlayersName,
    getOnlinePlayersNum
};